package com.example.boos.util;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

public class MyThreadPool {
    static ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(10,
            20,
            20, TimeUnit.MINUTES,
            new ArrayBlockingQueue<>(10),
            new ThreadPoolExecutor.DiscardOldestPolicy());

    public static void doJob(Runnable job){
        threadPoolExecutor.execute(job);
    }
}
